import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import VueRouter from 'vue-router'
import 'ant-design-vue/dist/antd.css'
import {
  Button,
  Layout,
  Menu,
  Icon,
  Avatar,
  Card,
  Table,
  Tag,
  Divider,
  Modal,
  message,
  Form,
  FormModel,
  Input,
  Upload,
  Dropdown,
  Select,
  Checkbox
} from 'ant-design-vue'

Vue.use(Button)
  .use(Layout)
  .use(Menu)
  .use(Icon)
  .use(Avatar)
  .use(Card)
  .use(Table)
  .use(Tag)
  .use(Divider)
  .use(Modal)
  .use(message)
  .use(Form)
  .use(FormModel)
  .use(Input)
  .use(Upload)
  .use(Dropdown)
  .use(Select)
  .use(Checkbox)

Vue.prototype.$confirm = Modal.confirm
Vue.prototype.$message = message

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
